#include "junix.h"

int main(int argc, char **argv)
{
	char m1[]="helloworld";
	char m2[]={'o','w','o'};

	char *p=NULL ;
	if ( (p=memmem( m1, sizeof(m1), m2 ,sizeof(m2))) != NULL)
		printf("%s\n",p);

	if( (p=strstr(m1,"llo")) != NULL)
		printf("match:%s\n", p);

	p=memchr( m1, 'o', sizeof(m1) );
	printf("%s\n",p);

	p=memrchr( m1, 'o', sizeof(m1) );
	printf("%s\n",p);

	p=index( m1, 'o' );
	printf("%s\n",p);

	int offset=5;
	memmove( m1, m1+offset, sizeof(m1)-offset );
	printf("%s\n",m1);

	if( memcmp( m1, m2, 3) >0 )
		printf("m1<m2\n");

	memccpy(m1,"JJKKoP",'o',sizeof(m1));
	printf("%s\n", m1);

    exit(0);
}

